package com.example.industrialpipelinemonitoring.controller;

import com.example.industrialpipelinemonitoring.service.UserService;
import com.example.industrialpipelinemonitoring.utils.AjaxResult;
import com.example.industrialpipelinemonitoring.dto.LoginDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Dsy
 * @create 2021-11-04  20:17
 */
@RestController
@RequestMapping("sys")
public class LoginController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public AjaxResult login(@RequestBody LoginDTO dto){
        return userService.login(dto);
    }
}
